<script src="<?php echo base_url().'assets/js/jquery.tablesorter.min.js'; ?>" type="text/javascript"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#adminTable").tablesorter({
			 headers: {
               0: {sorter: false},
               5: {sorter: false}
             }
		})
	});
</script>
<div class="content">
	<div id="top-heading">
		<div id="h-links">
			<!--<form action="<?php echo base_url()?>admin/users/search" method="POST">-->
			<?php
			//echo anchor(site_url(). '/admin/users/create', 'Create User', 'id="add-new" class="button"');
			//echo anchor('#', 'Delete', 'id="delete" class="button"');
			//echo form_input('search_text','','id="search-text"');
			//echo anchor('#','Search Users', 'id="search-btn" class="button"');
			?>
			<!--<input type="submit" value="Search Users" class="button" id="search-btn"/>
			</form>-->
		</div>
		<div id="pagination">
		<?php echo $pagination; ?>
		</div>
	</div>
	<?php echo form_open('admin/product_packages', array('name'=>'adminForm','id'=>'adminForm')); ?>
	
	<?php
	$this->message->display();
	$this->load->library('table');
	$tmpl = array( 'table_open' => '<table border="1" class="admin-table" id="adminTable">' );
	$this->table->set_template($tmpl);
	$h = array();
	$h[] = array('data' => '#', 'width' => '3%');
	//$h[] = array('data' => '<input type="checkbox" id="checkall" class="inputbox"/>', 'width' => '3%');
	//$h[] = array('data' => 'Edit', 'width' => '10%');
	$h[] = array('data' => 'Name');
	$h[] = array('data' => 'Description');
	$h[] = array('data' => 'Price','width' => '10%');
	$h[] = array('data' => 'Expiration Date');
	$h[] = array('data' => 'Quantity','width' => '5%');
	//$h[] = array('data' => 'Active', 'width' => '5%');
	$h[] = array('data' => 'ID', 'width' => '5%');

	$this->table->set_heading($h);

	$table_row = array();
	$i = 1;

	if(!empty($package_qry_limited)){
		foreach ($package_qry_limited as $package){
			$table_row = null;
			$table_row[] = $i++;
			//$table_row[] = '<input type="checkbox" name="checkid[]" value="'.$package['productid'].'" class="checkbox" />';
			//$table_row[] = anchor('admin/product_packages/edit/'.$package['productid'], 'Edit');
			$table_row[] = $package['name'];
			$table_row[] = $package['description'];
			$table_row[] = $this->config->item('currency_symbol').$package['price'];
			$table_row[] = $package['expiration_date'];
			$table_row[] = $package['quantity'];
			//$table_row[] = Boolean_helper::status($package['enable'], true,$package['productid']);
			$table_row[] = $package['productid'];
			$this->table->add_row($table_row);
		}
	}else{
		$table_row = null;
		$table_row[] = array('data' => 'No record found.', 'colspan' => '8');
		$this->table->add_row($table_row);
	}
	echo $this->table->generate();
	?>
	<input type="hidden" name="task" id="task" />
	<?php echo form_close();
	?>

</div>
